
#ifndef _TOWER_H
#define _TOWER_H
#include <iostream>
#include <SFML/Graphics.hpp>
#include <list>

#include "entity.h"


class Tower : public Entity
{
public:
	
	Tower();
	//copy constructor
	Tower(const Entity&);
	static bool Register_With_ScriptEngine();


	

	virtual void Update_Logic( asIScriptContext * );
	virtual void PrepareSpawn(const b2Vec2 &start);

	virtual void Render(sf::RenderWindow * rendow);
	
	virtual bool Get_Config(const std::string& resource_dir);

	//Function that searches for an enemy target
	bool FindTarget();

	//return the target 
	Entity* GetTarget() { return target; }


	//Images/sprites used to represent the tower
	 sf::Image *base_img, *gun_img;
	 sf::Sprite baseSprite, gunSprite;

	 //Get range
	 int GetRange() { return range; }
	 float GetRateOfFire() { return rate_of_fire; }

	 //Entity list reference
	static std::list<Entity*> *entity_list_reference;


	
	string projectile_name;

private:
	
	virtual void copyEntity(const Entity *);

	//Tower stuff
	int range;

	float rate_of_fire;
	float fire_timer;

	//pointer to target creep
	bool has_target;
	Entity *target;


};


#endif
